<?php
$temp = '<ul>';

foreach ($data as $id => $name)
{
    $temp = '<li>'.$name.'</li>';
}
$temp .= '</ul>';

return $temp;
?>